package com.smart.four.ioc.context;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * beans.xml 用java类取代xml
 *
 * @author junrui.wang
 * @create 2018/4/28
 */

@Configuration  //表示是一个配置信息提供类
public class Beans {
    @Bean(name = "car")  //定义一个bean
    public Car buildCar(){
        Car car = new Car("红旗", "blue", 200);
        return car;
    }
}
